home *** CD-ROM | disk | FTP | other *** search
- property spriteNum, loop, numframes, inframe, outframe, mylist, Dir, pos, playin, oldpos, mycount, sn, maxframes
- global recording, composerect, composewidth, composeheight
-
- on beginSprite me
- loop = 0
- mylist = []
- numframes = 0
- inframe = 1
- outframe = 1
- Dir = 1
- pos = 0
- oldpos = pos
- playin = 0
- mycount = 0
- recording = 0
- sn = sprite(spriteNum)
- maxframes = 64
- end
-
- on changelist me, whatlist
- mylist = whatlist
- if mylist = [] then
- mylist = [image(composewidth, composeheight, 32)]
- end if
- inframe = 1
- outframe = mylist.count
- mycount = outframe
- member("endfield").text = string(outframe)
- pos = 1
- sn.member.image.copyPixels(mylist[pos], sn.member.image.rect, mylist[pos].rect)
- member("current_point_field").text = string(pos)
- repeat with s = spriteNum - 1 to spriteNum + 21
- sprite(s).visible = 1
- end repeat
- sprite(480).locH = 384
- sprite(481).locH = 543
- sprite(479).rect = rect(386, 167, 543, 173)
- sprite(478).locH = 388
- end
-
- on exitFrame me
- if sn.visible then
- if playin then
- if not recording then
- if mylist.count > 0 then
- pos = pos + Dir
- if pos < inframe then
- if loop then
- pos = outframe
- else
- pos = inframe
- playin = 0
- end if
- else
- if pos > outframe then
- if loop then
- pos = inframe
- else
- pos = outframe
- playin = 0
- end if
- else
- end if
- end if
- end if
- else
- pos = pos + Dir
- if pos > maxframes then
- if loop then
- pos = 1
- else
- recording = 0
- pos = maxframes
- end if
- end if
- if pos < 1 then
- if loop then
- pos = maxframes
- else
- recording = 0
- pos = 1
- end if
- end if
- end if
- end if
- if recording then
- outframe = max(pos, outframe)
- mycount = outframe
- if pos > mylist.count then
- mylist[pos] = image(composewidth, composeheight, 32)
- end if
- if mylist[pos].ilk <> #image then
- mylist[pos] = image(composewidth, composeheight, 32)
- end if
- mylist[pos].copyPixels((the stage).image, composerect, composerect)
- end if
- if oldpos <> pos then
- newloc = sprite(spriteNum + 10).left + (pos / float(mycount) * sprite(spriteNum + 10).width)
- sprite(spriteNum + 11).locH = newloc
- sprite(spriteNum).member.image.copyPixels(mylist[pos], sprite(spriteNum).member.image.rect, mylist[pos].rect)
- member("current_point_field").text = string(pos)
- oldpos = pos
- end if
- end if
- end
-